<template>
  <div class="shipping-address">
    <div class="page-header">
      <div class="page-title" style="cursor: pointer;" @click="handleGoBack">
        <i class="el-icon-arrow-left"></i> 收件地址
      </div>
      <button type="button" class="el-button el-button--primary el-button--small" @click="handleAddAddress"><!---->
        <i class="el-icon-plus"></i><span>新增地址</span></button>
    </div>
    <div class="page-content">
      <div class="address_list">
        <div class="item">
          <div class="info">
            <div class="name-and-mobile">
              <span class="name">样样</span>
              <span class="mobile">&nbsp;&nbsp;+93 15055287798</span>
            </div>
            <div>
              <el-tooltip
                class="box-item"
                effect="light"
                content="Top Left prompts info"
                placement="bottom"
                trigger="click"
              >
              <template #content> 
                <ul class="address-menu" style="width: 250px;">
                  <li>编辑</li>
                  <li> 标记为默认送货地址 </li>
                  <li > 删除 </li>
                </ul>
              </template>
              <i class="el-icon-more el-popover__reference"></i>
              </el-tooltip>
            </div>
          </div>
          <div class="address"> 荷兰 乌得勒支 阿美龙根 详细地址</div>
        </div>
      </div><!---->
    </div>
    <el-dialog v-model="isAdd" title="添加地址/修改地址">
      <add-address />
    </el-dialog>
  </div>
</template>
<script setup>
  import { ref } from 'vue'
  import router from '@/router'
  import AddAddress from '@/components/mine/AddAddress.vue'
  const handleGoBack = () => {
    router.go(-1)
  }
  const isAdd = ref(false)
  const handleAddAddress = () => {
    isAdd.value = true
  }
</script>
<style scoped>
.shipping-address .page-header{
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between
}
.page-title {
  font-weight: 700;
  font-size: 24px;
  color: #333;
}
.shipping-address .page-content {
  min-height: 270px
}

.shipping-address .address_list {
  margin-top: 20px;
  overflow: hidden
}

.shipping-address .address_list>.item {
  width: 270px;
  height: 110px;
  padding: 20px 10px;
  font-size: 12px;
  float: left;
  border: 1px solid var(--color-border);
  margin-right: 22px;
  margin-bottom: 20px;
  border-radius: 4px
}

.shipping-address .address_list>.item:nth-child(3n) {
  margin-right: 0
}

.shipping-address .address_list>.item>img {
  width: 60px;
  height: 60px
}

.shipping-address .address_list>.item>.info {
  display: flex;
  align-items: center;
  margin-bottom: 15px
}

.shipping-address .address_list>.item>.info .name-and-mobile {
  flex: 1;
  font-weight: 400;
  color: var(--color-title)
}

.shipping-address .address_list>.item>.info .name-and-mobile span {
  display: inline-block;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.shipping-address .address_list>.item>.info .el-icon-more {
  font-size: 14px;
  color: var(--color-subtitle);
  margin-left: 10px;
  transform: rotate(90deg);
  cursor: pointer
}

.shipping-address .address_list>.item>.address {
  color: var(--color-subtitle);
  font-weight: 500;
  margin-top: 5px;
  width: 100%;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical
}

.address-menu>li {
  padding: 8px 10px;
  font-size: 12px
}

.address-menu>li:hover {
  cursor: pointer
}
:deep(.el-dialog){
  padding: 0 !important;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
:deep(.el-dialog .el-dialog__headerbtn) {
  top: 0px !important;
}
</style>